Skip to content

fix: auto-fix ESLint errors across 87 files#379

Closed
sweetmantech wants to merge 1 commit intotestfrom
fix/lint-auto-fix
Closed

fix: auto-fix ESLint errors across 87 files#379
sweetmantech wants to merge 1 commit intotestfrom
fix/lint-auto-fix

Conversation

@sweetmantech
Copy link
Copy Markdown
Contributor

@sweetmantech sweetmantech commented Mar 31, 2026

Summary

  • Ran pnpm lint to auto-fix 129 ESLint errors (mostly missing JSDoc stubs)
  • 87 files touched, all changes are auto-generated by ESLint --fix
  • All 1624 tests pass
  • Prerequisite for the lint CI workflow PR Add ESLint linting GitHub Action for PRs #377

Test plan

  • All 1624 tests pass
  • pnpm format:check passes
  • Remaining ~481 manual lint errors to be fixed incrementally

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Enhanced JSDoc comments throughout the codebase, adding comprehensive parameter documentation to numerous functions across API routes, utilities, and helper modules. These improvements provide better code clarity and IDE autocompletion support, making the codebase more maintainable for developers.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
recoup-api Ready Ready Preview Mar 31, 2026 0:10am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

Warning

Rate limit exceeded

@sweetmantech has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 35 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 8 minutes and 35 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 45ccb7c8-c35b-443a-aa1b-2b071b73606a

📥 Commits

Reviewing files that changed from the base of the PR and between 5e4d217 and 4c2d93f.

⛔ Files ignored due to path filters (28)
  • lib/admins/emails/__tests__/validateGetAdminEmailsQuery.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/admins/pr/__tests__/getPrMergedStatusHandler.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/artists/__tests__/createArtistPostHandler.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/artists/__tests__/validateCreateArtistBody.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/auth/__tests__/validateAuthContext.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/chat/__tests__/integration/chatEndToEnd.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/chats/__tests__/createChatHandler.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/coding-agent/__tests__/handleGitHubWebhook.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/coding-agent/__tests__/onMergeTestToMainAction.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/content/__tests__/validateCreateContentBody.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/evals/callChatFunctions.ts is excluded by !**/evals/** and included by lib/**
  • lib/evals/callChatFunctionsWithResult.ts is excluded by !**/evals/** and included by lib/**
  • lib/evals/createToolsCalledScorer.ts is excluded by !**/evals/** and included by lib/**
  • lib/evals/extractTextFromResult.ts is excluded by !**/evals/** and included by lib/**
  • lib/evals/extractTextResultFromSteps.ts is excluded by !**/evals/** and included by lib/**
  • lib/evals/getCatalogSongsCountExpected.ts is excluded by !**/evals/** and included by lib/**
  • lib/evals/getSpotifyFollowersExpected.ts is excluded by !**/evals/** and included by lib/**
  • lib/evals/scorers/CatalogAvailability.ts is excluded by !**/evals/** and included by lib/**
  • lib/evals/scorers/QuestionAnswered.ts is excluded by !**/evals/** and included by lib/**
  • lib/evals/scorers/ToolsCalled.ts is excluded by !**/evals/** and included by lib/**
  • lib/flamingo/__tests__/getFlamingoPresetsHandler.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/github/__tests__/createOrUpdateFileContent.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/notifications/__tests__/createNotificationHandler.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/notifications/__tests__/validateCreateNotificationBody.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/tasks/__tests__/enrichTaskWithTriggerInfo.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/tasks/__tests__/getTaskRunHandler.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/tasks/__tests__/validateGetTaskRunQuery.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/tasks/__tests__/validateGetTasksQuery.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
📒 Files selected for processing (59)
  • app/api/accounts/[id]/route.ts
  • app/api/admins/coding/slack/route.ts
  • app/api/admins/privy/route.ts
  • app/api/songs/analyze/presets/route.ts
  • app/api/transcribe/route.ts
  • lib/admins/pr/getPrStatusHandler.ts
  • lib/admins/privy/countNewAccounts.ts
  • lib/admins/privy/fetchPrivyLogins.ts
  • lib/admins/privy/getCutoffMs.ts
  • lib/admins/privy/getLatestVerifiedAt.ts
  • lib/admins/privy/toMs.ts
  • lib/ai/getModel.ts
  • lib/ai/isEmbedModel.ts
  • lib/catalog/formatCatalogSongsAsCSV.ts
  • lib/catalog/getCatalogDataAsCSV.ts
  • lib/catalog/getCatalogSongs.ts
  • lib/catalog/getCatalogs.ts
  • lib/chat/toolChains/getPrepareStepResult.ts
  • lib/chats/processCompactChatRequest.ts
  • lib/coding-agent/encodeGitHubThreadId.ts
  • lib/coding-agent/handleMergeSuccess.ts
  • lib/coding-agent/parseMergeActionId.ts
  • lib/coding-agent/parseMergeTestToMainActionId.ts
  • lib/composio/getCallbackUrl.ts
  • lib/content/contentTemplates.ts
  • lib/content/createContentHandler.ts
  • lib/content/getArtistContentReadiness.ts
  • lib/content/getArtistFileTree.ts
  • lib/content/getArtistRootPrefix.ts
  • lib/content/getContentValidateHandler.ts
  • lib/content/isCompletedRun.ts
  • lib/content/persistCreateContentRunVideo.ts
  • lib/content/validateCreateContentBody.ts
  • lib/content/validateGetContentEstimateQuery.ts
  • lib/content/validateGetContentValidateQuery.ts
  • lib/credits/getCreditUsage.ts
  • lib/credits/handleChatCredits.ts
  • lib/emails/processAndSendEmail.ts
  • lib/flamingo/getFlamingoPresetsHandler.ts
  • lib/github/expandSubmoduleEntries.ts
  • lib/github/getRepoGitModules.ts
  • lib/github/resolveSubmodulePath.ts
  • lib/mcp/resolveAccountId.ts
  • lib/mcp/tools/transcribe/registerTranscribeAudioTool.ts
  • lib/prompts/getSystemPrompt.ts
  • lib/slack/getBotChannels.ts
  • lib/slack/getBotUserId.ts
  • lib/slack/getSlackUserInfo.ts
  • lib/spotify/getSpotifyFollowers.ts
  • lib/supabase/account_artist_ids/getAccountArtistIds.ts
  • lib/supabase/account_workspace_ids/getAccountWorkspaceIds.ts
  • lib/supabase/files/createFileRecord.ts
  • lib/supabase/song_artists/insertSongArtists.ts
  • lib/supabase/storage/uploadFileByKey.ts
  • lib/transcribe/processAudioTranscription.ts
  • lib/transcribe/saveAudioToFiles.ts
  • lib/transcribe/saveTranscriptToFiles.ts
  • lib/transcribe/types.ts
  • lib/trigger/triggerCreateContent.ts
📝 Walkthrough

Walkthrough

This pull request adds JSDoc documentation comments (@param annotations and function descriptions) across approximately 60 files in the codebase. All changes are documentation-only; no runtime logic, function signatures, control flow, or behavior is modified.

Changes

Cohort / File(s) Summary
API Routes
app/api/accounts/[id]/route.ts, app/api/admins/coding/slack/route.ts, app/api/admins/privy/route.ts, app/api/songs/analyze/presets/route.ts, app/api/transcribe/route.ts
Added JSDoc @param annotations for request/handler parameters on GET/POST/OPTIONS handlers.
Admin Utilities
lib/admins/pr/getPrStatusHandler.ts, lib/admins/privy/*.ts
Added JSDoc parameter documentation for handler and utility functions (request, users, period, timestamps, account counting).
AI & Model Utilities
lib/ai/getModel.ts, lib/ai/isEmbedModel.ts
Added JSDoc @param annotations for model-related utility functions.
Catalog Management
lib/catalog/formatCatalogSongsAsCSV.ts, lib/catalog/getCatalogDataAsCSV.ts, lib/catalog/getCatalogSongs.ts, lib/catalog/getCatalogs.ts
Added JSDoc parameter documentation for catalog query and formatting functions.
Chat & Chat Chains
lib/chat/toolChains/getPrepareStepResult.ts, lib/chats/processCompactChatRequest.ts
Added JSDoc @param entries for chat request and tool chain processing functions.
Coding Agent
lib/coding-agent/encodeGitHubThreadId.ts, lib/coding-agent/handleMergeSuccess.ts, lib/coding-agent/parseMergeActionId.ts, lib/coding-agent/parseMergeTestToMainActionId.ts
Added JSDoc parameter documentation for GitHub thread and merge action handling functions.
Composio Integration
lib/composio/getCallbackUrl.ts
Added JSDoc @param options annotation for callback URL configuration.
Content Handling
lib/content/contentTemplates.ts, lib/content/createContentHandler.ts, lib/content/getArtistContentReadiness.ts, lib/content/getArtistFileTree.ts, lib/content/getArtistRootPrefix.ts, lib/content/getContentValidateHandler.ts, lib/content/isCompletedRun.ts, lib/content/persistCreateContentRunVideo.ts, lib/content/validateCreateContentBody.ts, lib/content/validateGetContentEstimateQuery.ts, lib/content/validateGetContentValidateQuery.ts
Added JSDoc @param documentation across content validation, artist file handling, and content state functions.
Credits System
lib/credits/getCreditUsage.ts, lib/credits/handleChatCredits.ts
Added JSDoc formatting and parameter documentation for credit tracking and usage functions.
Email Processing
lib/emails/processAndSendEmail.ts
Added JSDoc @param input annotation for email processing function.
Flamingo Presets
lib/flamingo/getFlamingoPresetsHandler.ts
Added JSDoc @param request annotation for preset handler.
GitHub Utilities
lib/github/expandSubmoduleEntries.ts, lib/github/getRepoGitModules.ts, lib/github/resolveSubmodulePath.ts
Added JSDoc documentation for nested object parameters in submodule and repository resolution functions.
MCP Tools & Integration
lib/mcp/resolveAccountId.ts, lib/mcp/tools/transcribe/registerTranscribeAudioTool.ts
Added JSDoc @param annotations for account ID resolution and MCP transcribe tool registration.
Prompt & System Config
lib/prompts/getSystemPrompt.ts
Added JSDoc documentation for orgId parameter in system prompt generation.
Slack Integration
lib/slack/getBotChannels.ts, lib/slack/getBotUserId.ts, lib/slack/getSlackUserInfo.ts
Added JSDoc @param entries for token and user ID parameters in Slack API wrapper functions.
Spotify Integration
lib/spotify/getSpotifyFollowers.ts
Added JSDoc formatting with blank line separator for artist follower retrieval function.
Supabase Database
lib/supabase/account_artist_ids/getAccountArtistIds.ts, lib/supabase/account_workspace_ids/getAccountWorkspaceIds.ts, lib/supabase/files/createFileRecord.ts, lib/supabase/song_artists/insertSongArtists.ts, lib/supabase/storage/uploadFileByKey.ts
Added JSDoc parameter documentation for database operations and storage utilities, with formatting improvements.
Transcription
lib/transcribe/processAudioTranscription.ts, lib/transcribe/saveAudioToFiles.ts, lib/transcribe/saveTranscriptToFiles.ts, lib/transcribe/types.ts
Added JSDoc @param annotations for transcription processing and file storage functions.
Trigger Integration
lib/trigger/triggerCreateContent.ts
Added JSDoc @param payload annotation for content trigger function.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

📚 With JSDoc in place, the code now sings,
Parameters documented, clear as spring,
No logic changed, just clarity gained—
Future readers blessed, maintainability reigned. ✨

🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Solid & Clean Code ⚠️ Warning JSDoc entries lack consistency and completeness: incomplete @param descriptions, malformed nested paths not matching function signatures, and redundant parameter documentation violate clean code principles. Review and fix flagged JSDoc entries by removing incorrect nested paths, adding descriptions to all @param entries, eliminating redundant documentation, and validating against actual function signatures before merging.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/lint-auto-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/api/transcribe/route.ts (1)

12-33: ⚠️ Potential issue | 🟠 Major

Route still bypasses auth-context and body-validation standards.

This handler accepts account_id from the request body and does not use validateAuthContext() + a Zod validate function, which conflicts with the API-route contract and can let callers act on arbitrary accounts. Please derive account context from auth and move input parsing to a dedicated validator.

As per coding guidelines, "Never use account_id in request bodies ... always derive the account ID from authentication", "Always use validateAuthContext() for authentication in API routes", and "All API endpoints should use a validate function for input parsing using Zod for schema validation."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/api/transcribe/route.ts` around lines 12 - 33, The route currently trusts
account_id in the request body and skips the shared auth/validation helpers;
change it to call validateAuthContext() to derive the owner account ID (use
authContext.accountId) instead of reading account_id from body, and create a
Zod-based input validator (e.g., validateTranscribeInput or
validateTranscribeBody) to parse/validate { audio_url, title,
include_timestamps, artist_account_id? } from the request body; then call
processAudioTranscription with ownerAccountId set from validateAuthContext(),
artistAccountId only if permitted/validated (or also derived from auth if
required), and the validated audioUrl/title/includeTimestamps. Ensure you remove
direct usage of body.account_id and add the new validateTranscribeInput and
validateAuthContext() calls in the handler.
🧹 Nitpick comments (26)
lib/emails/processAndSendEmail.ts (1)

37-38: Strengthen the JSDoc param description for maintainability

Good addition, but @param input is still too generic. Add a short description of expected fields (recipients/content/room context) so callers can understand usage without jumping to the interface definition.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/emails/processAndSendEmail.ts` around lines 37 - 38, Update the JSDoc for
the processAndSendEmail function to replace the generic "@param input" with a
brief description listing the expected fields (for example: recipients array,
content/body, subject, optional room or context identifier, and any metadata
like sender or attachments) so callers can understand what properties the input
object must contain without navigating to the interface; reference the parameter
name "input" and the function "processAndSendEmail" in the docblock and keep
descriptions one-line per field for clarity.
lib/catalog/getCatalogs.ts (1)

11-14: Improve JSDoc from stub to meaningful contract.

Nice addition, but the block is still a placeholder. Add a one-line function summary and a concrete @param accountId description so generated docs and IDE hints are useful.

Suggested JSDoc tweak
 /**
- *
- * `@param` accountId
+ * Fetches catalogs for the given account.
+ * `@param` accountId - Recoupable account identifier used as `account_id` query parameter.
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/catalog/getCatalogs.ts` around lines 11 - 14, Update the placeholder
JSDoc above the getCatalogs function to include a one-line summary describing
what getCatalogs does (e.g., "Retrieve available catalogs for an account") and a
concrete `@param` description for accountId (e.g., "accountId - unique identifier
of the account whose catalogs are being retrieved"). Ensure the block sits
immediately above the getCatalogs declaration and uses standard JSDoc tags so
IDEs and generated docs show the contract correctly.
lib/content/isCompletedRun.ts (1)

8-11: Make the JSDoc meaningful instead of a placeholder.

This stub satisfies linting but doesn’t add maintainability value. Please add a short summary and a descriptive @param (and optionally @returns) so intent is clear at call sites.

✍️ Suggested improvement
 /**
- *
- * `@param` run
+ * Returns true when a trigger run has reached COMPLETED status.
+ *
+ * `@param` run Trigger run payload containing status and metadata.
+ * `@returns` True if the run status is COMPLETED; otherwise false.
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/content/isCompletedRun.ts` around lines 8 - 11, Update the placeholder
JSDoc for the isCompletedRun function: replace the empty comment with a short
summary describing that isCompletedRun checks whether a run has reached a
terminal/completed state, add a descriptive `@param` for the run argument (e.g.,
"@param {Run} run - the run object to evaluate, including its status fields"),
and add a `@returns` tag (e.g., "@returns {boolean} true if the run is
completed/terminal, false otherwise") so callers understand intent and return
value; reference the isCompletedRun function name when making the change.
lib/content/contentTemplates.ts (1)

28-31: Complete the JSDoc contract (currently too skeletal).

Nice addition, but this block is effectively empty. Add a short function description, describe template, and include @returns so callers understand expected values quickly.

✍️ Suggested doc improvement
 /**
- *
- * `@param` template
+ * Checks whether a template name is one of the supported content templates.
+ *
+ * `@param` template - Template name to validate (e.g. "artist-caption-bedroom").
+ * `@returns` True when the template is supported; otherwise false.
  */
 export function isSupportedContentTemplate(template: string): boolean {
   return CONTENT_TEMPLATES.some(item => item.name === template);
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/content/contentTemplates.ts` around lines 28 - 31, Expand the skeletal
JSDoc above the function that accepts the parameter named "template" by adding a
one-line description of what the function does, a `@param` entry that describes
the "template" argument (include its expected type and shape or allowed values),
and an `@returns` entry that specifies the return type and what the return value
represents; update the JSDoc block for the function that references "template"
so callers can quickly see the behavior, input contract, and expected return
value.
lib/mcp/tools/transcribe/registerTranscribeAudioTool.ts (1)

18-21: Fill in the JSDoc stub with actual intent and parameter semantics.

The current block is effectively empty, so it doesn’t add much value for maintainers. A short summary + a concrete @param description would make this useful.

📝 Proposed JSDoc improvement
 /**
- *
- * `@param` server
+ * Registers the MCP tool that transcribes an audio URL and stores both
+ * the source audio file and generated transcript for the provided account.
+ *
+ * `@param` server MCP server instance where the `transcribe_audio` tool is registered.
  */
 export function registerTranscribeAudioTool(server: McpServer): void {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/mcp/tools/transcribe/registerTranscribeAudioTool.ts` around lines 18 -
21, Replace the empty JSDoc stub above registerTranscribeAudioTool with a short
sentence describing its intent (e.g., "Registers audio transcription
endpoints/tools on the application server") and add a concrete `@param` entry for
the server parameter that specifies the expected type (the framework server
instance used in this codebase), what the function does with it (registers
routes/middleware or mutates state), and any required properties or lifecycle
expectations; also add an `@returns` tag if registerTranscribeAudioTool returns a
value (or use `@returns` {void} if it does not). Ensure the JSDoc mentions side
effects (route registration) and any thrown errors or async behavior so future
maintainers know how to call it.
lib/supabase/storage/uploadFileByKey.ts (1)

7-11: Make JSDoc actionable, not placeholder-only.

The new @param tags are present, but they should include concise descriptions (and ideally @returns/@throws) so this doc block is useful for maintainers, not just lint-compliant.

♻️ Suggested JSDoc improvement
 /**
  * Upload file to Supabase storage by key
  *
- * `@param` key
- * `@param` file
- * `@param` options
- * `@param` options.contentType
- * `@param` options.upsert
+ * `@param` key Storage object key/path inside the configured bucket.
+ * `@param` file File or Blob payload to upload.
+ * `@param` options Optional upload configuration.
+ * `@param` options.contentType MIME type used by Supabase Storage (defaults to application/octet-stream).
+ * `@param` options.upsert Whether to overwrite an existing object with the same key (default: false).
+ * `@returns` Resolves when upload completes successfully.
+ * `@throws` {Error} If Supabase returns an upload error.
  */

As per coding guidelines, lib/supabase/**/*.ts: "Supabase database functions should import from @/lib/supabase/serverClient and follow the documented pattern with JSDoc comments, error handling, and return types".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/supabase/storage/uploadFileByKey.ts` around lines 7 - 11, Update the
JSDoc for the uploadFileByKey function to be actionable: for each `@param` (key,
file, options, options.contentType, options.upsert) add a one-line description
including expected types (e.g., string for key, Buffer|Blob|Readable for file,
object for options), behavior (what contentType and upsert control), and any
defaults; add an `@returns` describing the Promise shape (e.g., Supabase upload
response or uploaded path) and an `@throws` indicating what errors are thrown
(e.g., upload failure, validation errors). Ensure the description follows the
repo pattern used by other Supabase helpers (brief purpose line at top),
mentions that it uses the server client, and matches the function name
uploadFileByKey so maintainers can quickly find and understand the contract.
lib/catalog/getCatalogSongs.ts (1)

28-34: Improve JSDoc with concrete parameter semantics.

Nice addition of docs. Please add short descriptions for each @param (and optionally @returns) so callers know expected ranges/default behavior (e.g., page is 1-based, default pageSize=100, artistName is a filter string).

✍️ Suggested doc refinement
 /**
- *
- * `@param` catalogId
- * `@param` pageSize
- * `@param` page
- * `@param` artistName
+ * Fetches a single page of songs from a catalog.
+ *
+ * `@param` catalogId Catalog identifier to query.
+ * `@param` pageSize Maximum songs per page (default: 100).
+ * `@param` page 1-based page number (default: 1).
+ * `@param` artistName Optional artist-name filter.
+ * `@returns` Catalog songs payload with pagination metadata.
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/catalog/getCatalogSongs.ts` around lines 28 - 34, Update the JSDoc for
the getCatalogSongs function to include short, concrete descriptions for each
parameter and the return: document that catalogId is the target catalog
identifier, page is 1-based (default 1), pageSize defaults to 100 and defines
max items per page, and artistName is an optional filter string used to match
artist names; also add a brief `@returns` description of the returned paginated
song list (including shape or that it may be empty). Reference the
getCatalogSongs function and its params (catalogId, pageSize, page, artistName)
when making these edits.
lib/admins/privy/getLatestVerifiedAt.ts (1)

7-8: ESLint fix applied successfully.

The @param user annotation satisfies the ESLint requirement. The function description is clear and the parameter is well-typed.

If you'd like to further enhance the documentation, consider adding a parameter description and a @returns annotation:

  *
- * `@param` user
+ * `@param` user - The Privy user object containing linked accounts to check
+ * `@returns` The most recent verification timestamp in milliseconds, or null if none found
  */

This is entirely optional—the current documentation is functional and meets the linting requirements.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/admins/privy/getLatestVerifiedAt.ts` around lines 7 - 8, Add a brief
description for the existing `@param` user and add a `@returns` annotation to the
JSDoc for the getLatestVerifiedAt function so the documentation is more
informative; update the block above function getLatestVerifiedAt to include
one-line text describing the user parameter and a `@returns` line describing the
returned value (e.g., a Date or null) while keeping types consistent with the
function signature.
lib/mcp/resolveAccountId.ts (1)

19-20: Consider adding descriptions to the nested parameter tags.

The auto-generated @param tags satisfy the linter, but they'd be more valuable with brief descriptions explaining what each parameter represents and when it's used.

📝 Suggested improvement for JSDoc clarity
  * `@param` params - The auth info and optional account_id override.
- * `@param` params.authInfo
- * `@param` params.accountIdOverride
+ * `@param` params.authInfo - Authentication info from the MCP API key (contains accountId if authenticated)
+ * `@param` params.accountIdOverride - Optional account_id to use instead of the authenticated account (requires access validation)
  * `@returns` The resolved accountId or an error message.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/mcp/resolveAccountId.ts` around lines 19 - 20, The JSDoc for
resolveAccountId.ts currently lists nested `@param` tags (params.authInfo,
params.accountIdOverride) with no descriptions; update the JSDoc for the
resolveAccountId function to add concise descriptions for each nested param
explaining what authInfo contains (e.g., credentials/token and its expected
shape) and when accountIdOverride is used (e.g., to force a specific account id
instead of deriving it), so readers and linters get meaningful documentation for
params.authInfo and params.accountIdOverride.
lib/catalog/formatCatalogSongsAsCSV.ts (1)

5-6: Consider completing the @param description for better documentation quality.

The @param tag was successfully added by the ESLint auto-fix, which is great progress. However, JSDoc best practices recommend including a description to explain the parameter's purpose.

📝 Suggested enhancement
 /**
  * Formats catalog songs into the CSV-like format expected by the scorer
  *
- * `@param` songs
+ * `@param` songs - Array of catalog songs to format as CSV
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/catalog/formatCatalogSongsAsCSV.ts` around lines 5 - 6, The JSDoc `@param`
for the songs parameter on formatCatalogSongsAsCSV is missing a description;
update the comment for the function formatCatalogSongsAsCSV to include a brief
description of the songs parameter (e.g., "songs — array of Song objects to
format as CSV" or similar, and optionally the expected element type like
Song[]), so the JSDoc clearly documents the parameter's purpose and type.
lib/chat/toolChains/getPrepareStepResult.ts (1)

18-73: Consider splitting function to stay under 50-line guideline.

The function spans 55 lines, slightly exceeding the coding guideline that recommends keeping functions under 50 lines. Consider extracting the sequence position finding logic (lines 30-43) or the result building logic (lines 48-69) into separate helper functions.

♻️ Example refactor to reduce function length
/**
 * Finds the current position in a tool sequence by matching against the execution timeline.
 */
const findSequencePosition = (
  executedTimeline: string[],
  fullSequence: Array<{ toolName: string }>,
  triggerIndex: number
): number => {
  let sequencePosition = 0;
  let timelinePosition = triggerIndex;

  while (timelinePosition < executedTimeline.length && sequencePosition < fullSequence.length) {
    const currentTool = executedTimeline[timelinePosition];
    const expectedTool = fullSequence[sequencePosition].toolName;

    if (currentTool === expectedTool) {
      sequencePosition++;
    }
    timelinePosition++;
  }

  return sequencePosition;
};

Then simplify the main function by calling const sequencePosition = findSequencePosition(executedTimeline, fullSequence, triggerIndex);

As per coding guidelines: "Keep functions under 50 lines" for functions in lib/**/*.ts.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/chat/toolChains/getPrepareStepResult.ts` around lines 18 - 73,
getPrepareStepResult is over the 50-line guideline; extract the
sequence-matching loop and the result-construction block into helpers to reduce
its size: create a findSequencePosition(executedTimeline, fullSequence,
triggerIndex) that returns sequencePosition (move lines ~30-43 there) and a
buildPrepareStepResult(nextToolItem, options) that builds and returns the
PrepareStepResult (move lines ~48-69 there), then call these helpers from
getPrepareStepResult to keep it concise and under 50 lines while preserving the
existing behavior and references to TOOL_CHAINS, TOOL_MODEL_MAP, and
getExecutedToolTimeline.
lib/supabase/files/createFileRecord.ts (1)

28-29: Consider adding a description to the @param annotation.

The @param params stub satisfies ESLint but could be more helpful with a brief description of the parameter's purpose.

📝 Optional enhancement for better documentation
 /**
  * Create a file record in the database
  *
- * `@param` params
+ * `@param` params - The file record parameters including account IDs, storage key, and metadata
  */

Or for more comprehensive documentation, you could document the object properties:

 /**
  * Create a file record in the database
  *
- * `@param` params
+ * `@param` params - The file record parameters
+ * `@param` params.ownerAccountId - Account ID of the file owner
+ * `@param` params.artistAccountId - Account ID of the associated artist
+ * `@param` params.storageKey - Storage key for the uploaded file
+ * `@param` params.fileName - Name of the file
+ * `@param` params.mimeType - MIME type of the file
+ * `@param` params.sizeBytes - Size of the file in bytes
+ * `@param` params.description - Optional description of the file
+ * `@param` params.tags - Optional tags for categorization
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/supabase/files/createFileRecord.ts` around lines 28 - 29, The JSDoc for
createFileRecord currently has a stubbed "@param params" entry; update the
comment for the createFileRecord function to describe what params represents
(e.g., an object containing file metadata like name, path, bucket, mimeType,
size, and any optional fields) or enumerate its properties (e.g., params.name,
params.path, params.bucket, params.mimeType, params.size) so readers and linters
get useful documentation; locate the createFileRecord function and replace the
"@param params" line with a concise description or a short list of param
properties.
lib/content/persistCreateContentRunVideo.ts (1)

33-127: Consider refactoring for Single Responsibility Principle.

This function handles multiple concerns: validation, database lookups, external fetching, storage uploads, record creation, race condition handling, and URL generation. At 95 lines, it exceeds the 50-line guideline. Consider extracting helper functions such as:

  • downloadVideoFromUrl(url: string) for the fetch logic (lines 76-82)
  • ensureFileRecord(params) for the create-or-select pattern (lines 91-107)
  • buildVideoOutput(file, signedUrl) for constructing the output object (lines 64-71, 117-124)

This would improve testability and maintainability. As per coding guidelines, lib functions should keep functions under 50 lines and follow Single Responsibility Principle.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/content/persistCreateContentRunVideo.ts` around lines 33 - 127,
persistCreateContentRunVideo is doing too many things and should be split into
focused helpers; extract the fetch/download logic into
downloadVideoFromUrl(videoSourceUrl) to return a Blob and mimeType (replace
lines where fetch/response.blob/headers are used), extract the create-or-select
DB logic into ensureFileRecord({ownerAccountId, storageKey, fileName, mimeType,
sizeBytes, ...}) to encapsulate createFileRecord with the race-condition
re-select, and extract the output assembly into buildVideoOutput(fileRecord,
signedUrl) to produce the video output shape; update
persistCreateContentRunVideo to call these helpers in sequence (validate inputs,
call downloadVideoFromUrl, uploadFileByKey, call ensureFileRecord,
createSignedFileUrlByKey, then call buildVideoOutput) so behavior and error
handling remain identical but the main function stays under ~50 lines and each
concern is testable.
lib/github/expandSubmoduleEntries.ts (1)

14-22: JSDoc @param paths are inconsistent with the destructured function parameter.

The parameter object has three sibling properties (regularEntries, submoduleEntries, repo), but the docs incorrectly nest submoduleEntries and repo under regularEntries. Either use root0 for the parameter name and nest all properties under it (matching patterns in lib/evals/ and other files), or refactor the function signature to accept a named parameter (e.g., params) and document nested paths accordingly.

Suggested refactor
-export async function expandSubmoduleEntries({
+export async function expandSubmoduleEntries(params: {
   regularEntries,
   submoduleEntries,
   repo,
-}: {
   regularEntries: FileTreeEntry[];
   submoduleEntries: SubmoduleRef[];
   repo: { owner: string; repo: string; branch: string };
-}): Promise<FileTreeEntry[]> {
+}): Promise<FileTreeEntry[]> {
+  const { regularEntries, submoduleEntries, repo } = params;
   const submodules = await getRepoGitModules(repo);

Then update JSDoc:

 /**
  * Expands git submodule references into full directory trees.
  * Resolves submodule URLs from .gitmodules, fetches each submodule's tree,
  * and merges the results into the regular entries with correct path prefixes.
  *
- * `@param` regularEntries.regularEntries
- * `@param` regularEntries - Non-submodule file tree entries
- * `@param` submoduleEntries - Submodule references (type "commit" from GitHub Trees API)
- * `@param` repo - Repository context for fetching .gitmodules
- * `@param` regularEntries.submoduleEntries
- * `@param` regularEntries.repo
- * `@param` regularEntries.repo.owner
- * `@param` regularEntries.repo.repo
- * `@param` regularEntries.repo.branch
+ * `@param` params - Input payload
+ * `@param` params.regularEntries - Non-submodule file tree entries
+ * `@param` params.submoduleEntries - Submodule references (type "commit" from GitHub Trees API)
+ * `@param` params.repo - Repository context for fetching .gitmodules
+ * `@param` params.repo.owner - Repository owner
+ * `@param` params.repo.repo - Repository name
+ * `@param` params.repo.branch - Repository branch
  * `@returns` Combined file tree entries with submodules expanded as directories
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/github/expandSubmoduleEntries.ts` around lines 14 - 22, The JSDoc param
paths don't match the destructured parameter in expandSubmoduleEntries; update
the function signature docs to match the actual top-level parameter shape
(either change the function to accept a single named param like params/root0 and
document params.regularEntries, params.submoduleEntries, params.repo, or keep
the current destructured signature and document each top-level property with
`@param` regularEntries, `@param` submoduleEntries, `@param` repo and their
subproperties like `@param` repo.owner, `@param` repo.repo, `@param` repo.branch).
Ensure the names in the JSDoc exactly match the identifiers used in the function
(e.g., expandSubmoduleEntries's parameter names) so the docs are consistent.
lib/slack/getSlackUserInfo.ts (1)

19-21: Consider adding parameter descriptions to JSDoc.

The @param token and @param userId tags would be more helpful with descriptions.

📝 Suggested improvement
 /**
  * Fetches a Slack account's display name and avatar by their Slack ID.
  *
- * `@param` token
- * `@param` userId
+ * `@param` token - Slack bot authentication token
+ * `@param` userId - Slack user ID to look up
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/slack/getSlackUserInfo.ts` around lines 19 - 21, Add descriptive JSDoc
text for the function parameters in getSlackUserInfo: update the existing `@param`
token and `@param` userId tags to explain what each value is (e.g., token = Slack
API bearer token used for authentication; userId = Slack user ID whose profile
is being fetched) and include expected formats or constraints if any (string,
required, etc.) so future readers know how to call getSlackUserInfo.
lib/transcribe/saveTranscriptToFiles.ts (1)

5-8: Add function and parameter descriptions to JSDoc.

The JSDoc block lacks both a function description and parameter details.

📝 Suggested improvement
 /**
- *
- * `@param` params
+ * Uploads transcript markdown to storage and creates a file record.
+ *
+ * `@param` params - Transcript metadata including markdown content and account IDs
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/transcribe/saveTranscriptToFiles.ts` around lines 5 - 8, Add a clear
JSDoc summary for the saveTranscriptToFiles function and document its parameters
and return value: update the existing /** ... */ above saveTranscriptToFiles to
include a one-line description of what the function does, a `@param` block
describing the "params" object and each expected property (types and purpose),
and a `@returns/`@throws description if the function returns a value or can throw
errors; reference the saveTranscriptToFiles function and the params parameter by
name so future readers know what inputs and outputs to expect.
lib/slack/getBotChannels.ts (1)

12-13: Consider adding parameter description to JSDoc.

The @param token tag would be more useful with a description of what token is expected.

📝 Suggested improvement
 /**
  * Returns all channels the bot is a member of, paginating through all results.
  *
- * `@param` token
+ * `@param` token - Slack bot authentication token
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/slack/getBotChannels.ts` around lines 12 - 13, Update the JSDoc for the
getBotChannels function to add a clear description for the `@param` token tag:
explain what token represents (e.g., a Slack bot OAuth token or user token),
expected format (string), and any permissions/scopes required; locate the JSDoc
above the getBotChannels function in lib/slack/getBotChannels.ts and modify the
`@param` token line to include this information so callers know what to pass.
lib/transcribe/processAudioTranscription.ts (2)

10-11: Add parameter description to JSDoc.

The @param params tag would benefit from a description of what parameters are expected.

📝 Suggested improvement
 /**
  * Fetches audio from URL, transcribes it with OpenAI Whisper, and saves both
  * the original audio and transcript markdown to the customer's files.
  *
- * `@param` params
+ * `@param` params - Transcription parameters including audio URL, account IDs, and options
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/transcribe/processAudioTranscription.ts` around lines 10 - 11, The JSDoc
for processAudioTranscription is missing a description for the params parameter;
update the `@param` params tag to describe the expected object shape and fields
(e.g., audioBuffer or filePath, language, model, options like diarization or
timestamps, and any callback or logger) so callers know what to pass; modify the
JSDoc above the processAudioTranscription function to include a concise
description and list each expected property name/type and whether it is
required.

69-72: Add function and parameter descriptions to JSDoc.

The helper function's JSDoc block is incomplete with an empty description and no parameter details.

📝 Suggested improvement
 /**
- *
- * `@param` contentType
+ * Determines the appropriate file extension from a MIME content type.
+ *
+ * `@param` contentType - MIME type string (e.g., "audio/mp3", "audio/wav")
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/transcribe/processAudioTranscription.ts` around lines 69 - 72, The JSDoc
above the helper function is empty; add a short description of what the helper
does and document its parameter(s) and return value — specifically describe the
contentType parameter (expected MIME type string, allowed values, and how it's
used) and the function's return type/behavior; update the JSDoc block for the
helper function that accepts contentType so it contains `@param` {string}
contentType with a clear description and an `@returns` tag describing the return
value or side effects.
lib/transcribe/saveAudioToFiles.ts (1)

5-8: Add function and parameter descriptions to JSDoc.

The JSDoc block is incomplete with an empty description line and no parameter details. Adding context improves maintainability.

📝 Suggested improvement
 /**
- *
- * `@param` params
+ * Uploads audio blob to storage and creates a file record.
+ *
+ * `@param` params - Audio file metadata including blob, content type, and account IDs
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/transcribe/saveAudioToFiles.ts` around lines 5 - 8, Update the empty
JSDoc for the saveAudioToFiles function: provide a one-line description of what
saveAudioToFiles does, document each parameter passed in via the params object
(name, type and purpose — e.g., audioBuffer or stream, outputPath, fileName,
format, options), and add a `@returns` entry describing the resolved value or
Promise return (and any thrown errors). Reference the saveAudioToFiles function
and its params object so the JSDoc clearly explains inputs and outputs for
future maintainers.
lib/admins/privy/countNewAccounts.ts (1)

8-10: Consider adding parameter descriptions to JSDoc.

The @param users and @param period tags would benefit from brief descriptions explaining their purpose and expected values.

📝 Suggested improvement
 /**
  * Counts how many users in the list were created within the cutoff period.
  *
- * `@param` users
- * `@param` period
+ * `@param` users - Array of Privy user objects to filter
+ * `@param` period - Time period to check for account creation
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/admins/privy/countNewAccounts.ts` around lines 8 - 10, Update the JSDoc
for the countNewAccounts function to add brief descriptions for the `@param` tags:
describe what the users parameter expects (e.g., array of user objects or user
records and any required properties) and what the period parameter represents
(e.g., time window format such as number of days, start/end timestamps, or ISO
date range). Locate the JSDoc block immediately above the countNewAccounts
function and replace the placeholder `@param` users and `@param` period lines with
concise descriptions clarifying expected types and semantics.
lib/content/validateGetContentEstimateQuery.ts (1)

18-19: Consider adding parameter descriptions to JSDoc.

The @param request tag lacks a description. While the function-level comment is helpful, describing what the parameter represents improves documentation completeness.

📝 Suggested improvement
 /**
  * Validates auth and query params for GET /api/content/estimate.
  *
- * `@param` request
+ * `@param` request - The incoming Next.js request containing auth headers and query parameters
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/content/validateGetContentEstimateQuery.ts` around lines 18 - 19, Update
the JSDoc for the function validateGetContentEstimateQuery by expanding the
`@param request` tag to describe what the parameter represents (e.g., the
incoming query/request object for content estimate validation, including any
expected properties such as content type, length, or other fields used by
validateGetContentEstimateQuery). Keep the description concise and specific so
future readers know the shape/purpose of `request` when scanning the
validateGetContentEstimateQuery declaration.
lib/content/getArtistFileTree.ts (1)

7-9: Make @param docs explicit instead of placeholders.

The new JSDoc tags are currently empty, so they don’t help callers understand expected values/formats for githubRepo and artistSlug. Please add short, concrete descriptions.

Proposed doc-only improvement
 /**
  * Gets the file tree that contains the artist, checking the main repo
  * first, then falling back to org submodule repos.
  *
- * `@param` githubRepo
- * `@param` artistSlug
+ * `@param` githubRepo - Canonical GitHub repository URL (main sandbox repo).
+ * `@param` artistSlug - Artist folder slug to detect in repo paths.
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/content/getArtistFileTree.ts` around lines 7 - 9, The JSDoc for
getArtistFileTree currently has placeholder/empty `@param` tags for githubRepo and
artistSlug; update the comment above the getArtistFileTree function to replace
those placeholders with concise descriptions (e.g., githubRepo: full repository
identifier like "owner/repo" or a GitHub API repo object as expected by the
function; artistSlug: URL/filename-safe artist identifier used to locate the
artist's directory) so callers know the expected format and purpose of each
parameter.
lib/admins/privy/fetchPrivyLogins.ts (1)

23-26: Consolidate function docs; avoid split JSDoc blocks.

Right now the rich description is above FetchPrivyLoginsResult, and the function gets a near-empty stub. Move/merge the detailed docs to fetchPrivyLogins so documentation is attached to the correct symbol.

Proposed doc placement cleanup
-/**
- * Fetches Privy users active or created within the given period via the Privy Management API.
- * Returns the full, unmodified user objects from Privy.
- * Paginates through all users, collecting those whose created_at or latest_verified_at
- * falls within the time window.
- *
- * `@see` https://docs.privy.io/api-reference/users/get-all
- * `@param` period - "daily", "weekly", or "monthly"
- * `@returns` Array of full Privy user objects within the time window, sorted by created_at descending
- */
 export type FetchPrivyLoginsResult = {
   users: User[];
   totalPrivyUsers: number;
 };
 
 /**
- *
- * `@param` period
+ * Fetches Privy users active or created within the given period via the Privy Management API.
+ * Returns the full, unmodified user objects from Privy.
+ * Paginates through all users, collecting those whose created_at or latest_verified_at
+ * falls within the time window.
+ *
+ * `@see` https://docs.privy.io/api-reference/users/get-all
+ * `@param` period - "all", "daily", "weekly", or "monthly"
+ * `@returns` Full Privy users within the window, sorted by created_at descending, and total scanned count.
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/admins/privy/fetchPrivyLogins.ts` around lines 23 - 26, Merge the
separated JSDoc so the detailed description is attached to the actual function
symbol: remove the near-empty JSDoc block above FetchPrivyLoginsResult and
move/merge its rich documentation into the JSDoc immediately above the
fetchPrivyLogins function declaration; keep any parameter (`@param` period) and
return annotations consistent (referring to FetchPrivyLoginsResult where needed)
and ensure only fetchPrivyLogins carries the full descriptive comment so
generated docs link to the correct symbol.
app/api/admins/privy/route.ts (1)

18-20: Fill in the OPTIONS JSDoc body (currently empty).

The comment block is present, but adding a one-liner (preflight/CORS purpose) would make it useful to future maintainers.

Proposed doc-only improvement
 /**
- *
+ * OPTIONS /api/admins/privy
+ *
+ * Handles CORS preflight for the Privy admin endpoint.
  */
 export async function OPTIONS(): Promise<NextResponse> {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/api/admins/privy/route.ts` around lines 18 - 20, The empty JSDoc block
above the route handler should be replaced with a concise one-liner describing
its purpose—e.g., state that it handles CORS preflight/OPTIONS requests for the
admins/privy endpoint—so future maintainers know this is the OPTIONS (preflight)
handler; update the comment block in app/api/admins/privy/route.ts directly
above the route/handler definition to include that one-line description.
lib/content/getArtistContentReadiness.ts (1)

25-29: Replace root0.* JSDoc placeholders with meaningful argument docs.

The auto-generated root0 tags are hard to read. Please document the destructured object with explicit semantics for each field.

Proposed doc-only improvement
 /**
  * Checks whether an artist has the expected files for content creation.
  * Searches the main repo and org submodule repos.
  *
- * `@param` root0
- * `@param` root0.accountId
- * `@param` root0.artistAccountId
- * `@param` root0.artistSlug
+ * `@param` params - Input identifiers for readiness lookup.
+ * `@param` params.accountId - Account ID used to resolve sandbox snapshot metadata.
+ * `@param` params.artistAccountId - Artist account ID returned in the readiness response.
+ * `@param` params.artistSlug - Artist folder slug used to match content paths in GitHub.
  */
 export async function getArtistContentReadiness({
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/content/getArtistContentReadiness.ts` around lines 25 - 29, Update the
JSDoc for getArtistContentReadiness to replace the auto-generated root0
placeholders with meaningful parameter docs: document the function as taking a
single destructured params object (e.g., `@param` {Object} params) and add
explicit fields such as `@param` {string} params.accountId, `@param` {string}
params.artistAccountId, and `@param` {string} params.artistSlug (include types and
a short description for each) so readers can understand what each argument
represents; reference the getArtistContentReadiness function signature when
making these edits.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/api/accounts/`[id]/route.ts:
- Around line 26-27: Remove the incorrect JSDoc entry "@param params.params"
that duplicates and conflicts with the correct "@param params" for the
destructured handler parameter; update the JSDoc above the route handler (the
function that accepts "{ params }" in app/api/accounts/[id]/route.ts) so it only
documents "@param params - Route params containing the account ID" and remove
the redundant line to avoid confusion.

In `@lib/chat/toolChains/getPrepareStepResult.ts`:
- Around line 15-16: Update the JSDoc for the getPrepareStepResult function to
complete the `@param` documentation for the options parameter: describe that
options is an object passed into getPrepareStepResult, list the expected
properties (their names, types, and a one-line purpose for each), and indicate
which fields are optional vs required; ensure the description matches the actual
parameter shape used inside getPrepareStepResult so the docs are accurate and
helpful.

In `@lib/content/persistCreateContentRunVideo.ts`:
- Around line 30-31: Update the JSDoc for the persistCreateContentRunVideo
function by adding a clear description for the `@param` run annotation explaining
what the run object represents and the expected shape or key properties (e.g.,
id, status, metadata), and add an `@returns` annotation that describes the
function's return value (promise or synchronous return type and what it
contains, e.g., created content run record or void). Locate the JSDoc directly
above the persistCreateContentRunVideo declaration and ensure the descriptions
mention the same property names used inside persistCreateContentRunVideo to keep
docs accurate.

In `@lib/credits/handleChatCredits.ts`:
- Around line 15-20: The JSDoc for HandleChatCreditsParams in
lib/credits/handleChatCredits.ts has incorrect duplicate nested params
(usage.usage, usage.model, usage.accountId); update the comment to remove those
nested paths and only document the top-level parameters as defined in the
interface/function signature (usage, model, accountId) so the JSDoc matches
HandleChatCreditsParams and the destructured parameters used in the function.

In `@lib/github/getRepoGitModules.ts`:
- Around line 7-12: The JSDoc contains invalid nested param paths (owner.owner,
owner.repo, owner.branch); update the comment for the function
(getRepoGitModules) to remove those incorrect tags and ensure only top-level
`@param` entries exist for owner, repo, and branch (and keep any brief
descriptions), so the doc matches the actual destructured parameters.

In `@lib/github/resolveSubmodulePath.ts`:
- Around line 9-12: The JSDoc param lines are inconsistent with the destructured
signature in resolveSubmodulePath: replace the nested `@param`
githubRepo.githubRepo and `@param` githubRepo.path with either (A) document the
destructured properties directly—use `@param` {type} githubRepo - description and
`@param` {type} path - description to match the function's githubRepo and path
symbols—or (B) rename the function parameter to a single options object in the
signature and update JSDoc to `@param` {Object} options and `@param` {type}
options.githubRepo / `@param` {type} options.path; pick one approach and make the
JSDoc match the actual parameter names (resolveSubmodulePath, githubRepo, path).

In `@lib/prompts/getSystemPrompt.ts`:
- Line 16: The JSDoc for getSystemPrompt is missing a description for the
parameter params.orgId; update the JSDoc block for the getSystemPrompt (or the
function that accepts params) to include a short description like "Organization
ID; nullable/optional string identifying the org context" to match the other
param entries and reflect its nullable optional type.

---

Outside diff comments:
In `@app/api/transcribe/route.ts`:
- Around line 12-33: The route currently trusts account_id in the request body
and skips the shared auth/validation helpers; change it to call
validateAuthContext() to derive the owner account ID (use authContext.accountId)
instead of reading account_id from body, and create a Zod-based input validator
(e.g., validateTranscribeInput or validateTranscribeBody) to parse/validate {
audio_url, title, include_timestamps, artist_account_id? } from the request
body; then call processAudioTranscription with ownerAccountId set from
validateAuthContext(), artistAccountId only if permitted/validated (or also
derived from auth if required), and the validated
audioUrl/title/includeTimestamps. Ensure you remove direct usage of
body.account_id and add the new validateTranscribeInput and
validateAuthContext() calls in the handler.

---

Nitpick comments:
In `@app/api/admins/privy/route.ts`:
- Around line 18-20: The empty JSDoc block above the route handler should be
replaced with a concise one-liner describing its purpose—e.g., state that it
handles CORS preflight/OPTIONS requests for the admins/privy endpoint—so future
maintainers know this is the OPTIONS (preflight) handler; update the comment
block in app/api/admins/privy/route.ts directly above the route/handler
definition to include that one-line description.

In `@lib/admins/privy/countNewAccounts.ts`:
- Around line 8-10: Update the JSDoc for the countNewAccounts function to add
brief descriptions for the `@param` tags: describe what the users parameter
expects (e.g., array of user objects or user records and any required
properties) and what the period parameter represents (e.g., time window format
such as number of days, start/end timestamps, or ISO date range). Locate the
JSDoc block immediately above the countNewAccounts function and replace the
placeholder `@param` users and `@param` period lines with concise descriptions
clarifying expected types and semantics.

In `@lib/admins/privy/fetchPrivyLogins.ts`:
- Around line 23-26: Merge the separated JSDoc so the detailed description is
attached to the actual function symbol: remove the near-empty JSDoc block above
FetchPrivyLoginsResult and move/merge its rich documentation into the JSDoc
immediately above the fetchPrivyLogins function declaration; keep any parameter
(`@param` period) and return annotations consistent (referring to
FetchPrivyLoginsResult where needed) and ensure only fetchPrivyLogins carries
the full descriptive comment so generated docs link to the correct symbol.

In `@lib/admins/privy/getLatestVerifiedAt.ts`:
- Around line 7-8: Add a brief description for the existing `@param` user and add
a `@returns` annotation to the JSDoc for the getLatestVerifiedAt function so the
documentation is more informative; update the block above function
getLatestVerifiedAt to include one-line text describing the user parameter and a
`@returns` line describing the returned value (e.g., a Date or null) while keeping
types consistent with the function signature.

In `@lib/catalog/formatCatalogSongsAsCSV.ts`:
- Around line 5-6: The JSDoc `@param` for the songs parameter on
formatCatalogSongsAsCSV is missing a description; update the comment for the
function formatCatalogSongsAsCSV to include a brief description of the songs
parameter (e.g., "songs — array of Song objects to format as CSV" or similar,
and optionally the expected element type like Song[]), so the JSDoc clearly
documents the parameter's purpose and type.

In `@lib/catalog/getCatalogs.ts`:
- Around line 11-14: Update the placeholder JSDoc above the getCatalogs function
to include a one-line summary describing what getCatalogs does (e.g., "Retrieve
available catalogs for an account") and a concrete `@param` description for
accountId (e.g., "accountId - unique identifier of the account whose catalogs
are being retrieved"). Ensure the block sits immediately above the getCatalogs
declaration and uses standard JSDoc tags so IDEs and generated docs show the
contract correctly.

In `@lib/catalog/getCatalogSongs.ts`:
- Around line 28-34: Update the JSDoc for the getCatalogSongs function to
include short, concrete descriptions for each parameter and the return: document
that catalogId is the target catalog identifier, page is 1-based (default 1),
pageSize defaults to 100 and defines max items per page, and artistName is an
optional filter string used to match artist names; also add a brief `@returns`
description of the returned paginated song list (including shape or that it may
be empty). Reference the getCatalogSongs function and its params (catalogId,
pageSize, page, artistName) when making these edits.

In `@lib/chat/toolChains/getPrepareStepResult.ts`:
- Around line 18-73: getPrepareStepResult is over the 50-line guideline; extract
the sequence-matching loop and the result-construction block into helpers to
reduce its size: create a findSequencePosition(executedTimeline, fullSequence,
triggerIndex) that returns sequencePosition (move lines ~30-43 there) and a
buildPrepareStepResult(nextToolItem, options) that builds and returns the
PrepareStepResult (move lines ~48-69 there), then call these helpers from
getPrepareStepResult to keep it concise and under 50 lines while preserving the
existing behavior and references to TOOL_CHAINS, TOOL_MODEL_MAP, and
getExecutedToolTimeline.

In `@lib/content/contentTemplates.ts`:
- Around line 28-31: Expand the skeletal JSDoc above the function that accepts
the parameter named "template" by adding a one-line description of what the
function does, a `@param` entry that describes the "template" argument (include
its expected type and shape or allowed values), and an `@returns` entry that
specifies the return type and what the return value represents; update the JSDoc
block for the function that references "template" so callers can quickly see the
behavior, input contract, and expected return value.

In `@lib/content/getArtistContentReadiness.ts`:
- Around line 25-29: Update the JSDoc for getArtistContentReadiness to replace
the auto-generated root0 placeholders with meaningful parameter docs: document
the function as taking a single destructured params object (e.g., `@param`
{Object} params) and add explicit fields such as `@param` {string}
params.accountId, `@param` {string} params.artistAccountId, and `@param` {string}
params.artistSlug (include types and a short description for each) so readers
can understand what each argument represents; reference the
getArtistContentReadiness function signature when making these edits.

In `@lib/content/getArtistFileTree.ts`:
- Around line 7-9: The JSDoc for getArtistFileTree currently has
placeholder/empty `@param` tags for githubRepo and artistSlug; update the comment
above the getArtistFileTree function to replace those placeholders with concise
descriptions (e.g., githubRepo: full repository identifier like "owner/repo" or
a GitHub API repo object as expected by the function; artistSlug:
URL/filename-safe artist identifier used to locate the artist's directory) so
callers know the expected format and purpose of each parameter.

In `@lib/content/isCompletedRun.ts`:
- Around line 8-11: Update the placeholder JSDoc for the isCompletedRun
function: replace the empty comment with a short summary describing that
isCompletedRun checks whether a run has reached a terminal/completed state, add
a descriptive `@param` for the run argument (e.g., "@param {Run} run - the run
object to evaluate, including its status fields"), and add a `@returns` tag (e.g.,
"@returns {boolean} true if the run is completed/terminal, false otherwise") so
callers understand intent and return value; reference the isCompletedRun
function name when making the change.

In `@lib/content/persistCreateContentRunVideo.ts`:
- Around line 33-127: persistCreateContentRunVideo is doing too many things and
should be split into focused helpers; extract the fetch/download logic into
downloadVideoFromUrl(videoSourceUrl) to return a Blob and mimeType (replace
lines where fetch/response.blob/headers are used), extract the create-or-select
DB logic into ensureFileRecord({ownerAccountId, storageKey, fileName, mimeType,
sizeBytes, ...}) to encapsulate createFileRecord with the race-condition
re-select, and extract the output assembly into buildVideoOutput(fileRecord,
signedUrl) to produce the video output shape; update
persistCreateContentRunVideo to call these helpers in sequence (validate inputs,
call downloadVideoFromUrl, uploadFileByKey, call ensureFileRecord,
createSignedFileUrlByKey, then call buildVideoOutput) so behavior and error
handling remain identical but the main function stays under ~50 lines and each
concern is testable.

In `@lib/content/validateGetContentEstimateQuery.ts`:
- Around line 18-19: Update the JSDoc for the function
validateGetContentEstimateQuery by expanding the `@param request` tag to
describe what the parameter represents (e.g., the incoming query/request object
for content estimate validation, including any expected properties such as
content type, length, or other fields used by validateGetContentEstimateQuery).
Keep the description concise and specific so future readers know the
shape/purpose of `request` when scanning the validateGetContentEstimateQuery
declaration.

In `@lib/emails/processAndSendEmail.ts`:
- Around line 37-38: Update the JSDoc for the processAndSendEmail function to
replace the generic "@param input" with a brief description listing the expected
fields (for example: recipients array, content/body, subject, optional room or
context identifier, and any metadata like sender or attachments) so callers can
understand what properties the input object must contain without navigating to
the interface; reference the parameter name "input" and the function
"processAndSendEmail" in the docblock and keep descriptions one-line per field
for clarity.

In `@lib/github/expandSubmoduleEntries.ts`:
- Around line 14-22: The JSDoc param paths don't match the destructured
parameter in expandSubmoduleEntries; update the function signature docs to match
the actual top-level parameter shape (either change the function to accept a
single named param like params/root0 and document params.regularEntries,
params.submoduleEntries, params.repo, or keep the current destructured signature
and document each top-level property with `@param` regularEntries, `@param`
submoduleEntries, `@param` repo and their subproperties like `@param` repo.owner,
`@param` repo.repo, `@param` repo.branch). Ensure the names in the JSDoc exactly
match the identifiers used in the function (e.g., expandSubmoduleEntries's
parameter names) so the docs are consistent.

In `@lib/mcp/resolveAccountId.ts`:
- Around line 19-20: The JSDoc for resolveAccountId.ts currently lists nested
`@param` tags (params.authInfo, params.accountIdOverride) with no descriptions;
update the JSDoc for the resolveAccountId function to add concise descriptions
for each nested param explaining what authInfo contains (e.g., credentials/token
and its expected shape) and when accountIdOverride is used (e.g., to force a
specific account id instead of deriving it), so readers and linters get
meaningful documentation for params.authInfo and params.accountIdOverride.

In `@lib/mcp/tools/transcribe/registerTranscribeAudioTool.ts`:
- Around line 18-21: Replace the empty JSDoc stub above
registerTranscribeAudioTool with a short sentence describing its intent (e.g.,
"Registers audio transcription endpoints/tools on the application server") and
add a concrete `@param` entry for the server parameter that specifies the expected
type (the framework server instance used in this codebase), what the function
does with it (registers routes/middleware or mutates state), and any required
properties or lifecycle expectations; also add an `@returns` tag if
registerTranscribeAudioTool returns a value (or use `@returns` {void} if it does
not). Ensure the JSDoc mentions side effects (route registration) and any thrown
errors or async behavior so future maintainers know how to call it.

In `@lib/slack/getBotChannels.ts`:
- Around line 12-13: Update the JSDoc for the getBotChannels function to add a
clear description for the `@param` token tag: explain what token represents (e.g.,
a Slack bot OAuth token or user token), expected format (string), and any
permissions/scopes required; locate the JSDoc above the getBotChannels function
in lib/slack/getBotChannels.ts and modify the `@param` token line to include this
information so callers know what to pass.

In `@lib/slack/getSlackUserInfo.ts`:
- Around line 19-21: Add descriptive JSDoc text for the function parameters in
getSlackUserInfo: update the existing `@param` token and `@param` userId tags to
explain what each value is (e.g., token = Slack API bearer token used for
authentication; userId = Slack user ID whose profile is being fetched) and
include expected formats or constraints if any (string, required, etc.) so
future readers know how to call getSlackUserInfo.

In `@lib/supabase/files/createFileRecord.ts`:
- Around line 28-29: The JSDoc for createFileRecord currently has a stubbed
"@param params" entry; update the comment for the createFileRecord function to
describe what params represents (e.g., an object containing file metadata like
name, path, bucket, mimeType, size, and any optional fields) or enumerate its
properties (e.g., params.name, params.path, params.bucket, params.mimeType,
params.size) so readers and linters get useful documentation; locate the
createFileRecord function and replace the "@param params" line with a concise
description or a short list of param properties.

In `@lib/supabase/storage/uploadFileByKey.ts`:
- Around line 7-11: Update the JSDoc for the uploadFileByKey function to be
actionable: for each `@param` (key, file, options, options.contentType,
options.upsert) add a one-line description including expected types (e.g.,
string for key, Buffer|Blob|Readable for file, object for options), behavior
(what contentType and upsert control), and any defaults; add an `@returns`
describing the Promise shape (e.g., Supabase upload response or uploaded path)
and an `@throws` indicating what errors are thrown (e.g., upload failure,
validation errors). Ensure the description follows the repo pattern used by
other Supabase helpers (brief purpose line at top), mentions that it uses the
server client, and matches the function name uploadFileByKey so maintainers can
quickly find and understand the contract.

In `@lib/transcribe/processAudioTranscription.ts`:
- Around line 10-11: The JSDoc for processAudioTranscription is missing a
description for the params parameter; update the `@param` params tag to describe
the expected object shape and fields (e.g., audioBuffer or filePath, language,
model, options like diarization or timestamps, and any callback or logger) so
callers know what to pass; modify the JSDoc above the processAudioTranscription
function to include a concise description and list each expected property
name/type and whether it is required.
- Around line 69-72: The JSDoc above the helper function is empty; add a short
description of what the helper does and document its parameter(s) and return
value — specifically describe the contentType parameter (expected MIME type
string, allowed values, and how it's used) and the function's return
type/behavior; update the JSDoc block for the helper function that accepts
contentType so it contains `@param` {string} contentType with a clear description
and an `@returns` tag describing the return value or side effects.

In `@lib/transcribe/saveAudioToFiles.ts`:
- Around line 5-8: Update the empty JSDoc for the saveAudioToFiles function:
provide a one-line description of what saveAudioToFiles does, document each
parameter passed in via the params object (name, type and purpose — e.g.,
audioBuffer or stream, outputPath, fileName, format, options), and add a
`@returns` entry describing the resolved value or Promise return (and any thrown
errors). Reference the saveAudioToFiles function and its params object so the
JSDoc clearly explains inputs and outputs for future maintainers.

In `@lib/transcribe/saveTranscriptToFiles.ts`:
- Around line 5-8: Add a clear JSDoc summary for the saveTranscriptToFiles
function and document its parameters and return value: update the existing /**
... */ above saveTranscriptToFiles to include a one-line description of what the
function does, a `@param` block describing the "params" object and each expected
property (types and purpose), and a `@returns/`@throws description if the function
returns a value or can throw errors; reference the saveTranscriptToFiles
function and the params parameter by name so future readers know what inputs and
outputs to expect.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

Comment on lines +26 to 27
* @param params.params
* @param params - Route params containing the account ID
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove redundant and confusing @param params.params entry.

Line 26's @param params.params is incorrect for the destructured parameter syntax { params }. Line 27 already correctly documents the params object. The duplicate entry on line 26 should be removed to avoid confusion.

🧹 Proposed fix
  * `@param` request - The request object
- * `@param` params.params
  * `@param` params - Route params containing the account ID
  * `@returns` A NextResponse with account data
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* @param params.params
* @param params - Route params containing the account ID
* `@param` request - The request object
* `@param` params - Route params containing the account ID
* `@returns` A NextResponse with account data
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/api/accounts/`[id]/route.ts around lines 26 - 27, Remove the incorrect
JSDoc entry "@param params.params" that duplicates and conflicts with the
correct "@param params" for the destructured handler parameter; update the JSDoc
above the route handler (the function that accepts "{ params }" in
app/api/accounts/[id]/route.ts) so it only documents "@param params - Route
params containing the account ID" and remove the redundant line to avoid
confusion.

Comment on lines +15 to +16
*
* @param options
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Complete the JSDoc parameter documentation.

The @param tag is present but lacks a description. Since this PR aims to improve documentation, consider describing what the options parameter contains.

📝 Suggested enhancement for JSDoc completeness
  * Returns the next tool to run based on timeline progression through tool chains.
  * Uses toolCallsContent to track exact execution order and position in sequence.
  *
- * `@param` options
+ * `@param` options - The preparation step configuration containing steps, model, and messages

Or for more detailed documentation:

  * Returns the next tool to run based on timeline progression through tool chains.
  * Uses toolCallsContent to track exact execution order and position in sequence.
  *
- * `@param` options
+ * `@param` options - The preparation step configuration
+ * `@param` options.steps - Array of previous step results from the tool chain
+ * `@param` options.stepNumber - Current step number in the execution sequence
+ * `@param` options.model - Language model being used for this conversation
+ * `@param` options.messages - Array of model messages in the conversation
+ * `@returns` The next tool to execute in the chain, or undefined if sequence is complete
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
*
* @param options
/**
* Returns the next tool to run based on timeline progression through tool chains.
* Uses toolCallsContent to track exact execution order and position in sequence.
*
* `@param` options - The preparation step configuration containing steps, model, and messages
*/
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/chat/toolChains/getPrepareStepResult.ts` around lines 15 - 16, Update the
JSDoc for the getPrepareStepResult function to complete the `@param` documentation
for the options parameter: describe that options is an object passed into
getPrepareStepResult, list the expected properties (their names, types, and a
one-line purpose for each), and indicate which fields are optional vs required;
ensure the description matches the actual parameter shape used inside
getPrepareStepResult so the docs are accurate and helpful.

Comment on lines +30 to +31
*
* @param run
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Complete the JSDoc parameter documentation.

The @param annotation is missing a description. JSDoc best practices require parameter descriptions to explain the purpose and expected format of each parameter. Additionally, the function lacks a @returns annotation.

📝 Suggested improvement
  * This keeps Supabase writes in API only.
  *
- * `@param` run
+ * `@param` run - The trigger run containing create-content task output to persist
+ * `@returns` The run with normalized output including persisted video metadata
  */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
*
* @param run
* This keeps Supabase writes in API only.
*
* `@param` run - The trigger run containing create-content task output to persist
* `@returns` The run with normalized output including persisted video metadata
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/content/persistCreateContentRunVideo.ts` around lines 30 - 31, Update the
JSDoc for the persistCreateContentRunVideo function by adding a clear
description for the `@param` run annotation explaining what the run object
represents and the expected shape or key properties (e.g., id, status,
metadata), and add an `@returns` annotation that describes the function's return
value (promise or synchronous return type and what it contains, e.g., created
content run record or void). Locate the JSDoc directly above the
persistCreateContentRunVideo declaration and ensure the descriptions mention the
same property names used inside persistCreateContentRunVideo to keep docs
accurate.

Comment on lines +15 to +20
* @param usage.usage
* @param usage - The language model usage data
* @param model - The model ID used for the chat
* @param accountId - The account ID to deduct credits from (optional)
* @param usage.model
* @param usage.accountId
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify mismatched nested JSDoc params in this file and inspect function signature context.
rg -n -C2 '@param\s+usage\.(usage|model|accountId)' lib/credits/handleChatCredits.ts
rg -n -C2 'export const handleChatCredits\s*=\s*async\s*\(\s*\{' lib/credits/handleChatCredits.ts

Repository: recoupable/api

Length of output: 561


🏁 Script executed:

head -40 lib/credits/handleChatCredits.ts

Repository: recoupable/api

Length of output: 1155


🏁 Script executed:

rg -n 'type HandleChatCreditsParams\|interface HandleChatCreditsParams' lib/credits/handleChatCredits.ts

Repository: recoupable/api

Length of output: 40


Fix JSDoc parameter documentation—remove duplicate/incorrect nested paths.

The JSDoc contains conflicting parameter documentation. Lines 15 and 19–20 document usage.usage, usage.model, and usage.accountId as nested properties, but the interface HandleChatCreditsParams defines model and accountId as top-level fields alongside usage. This mismatch creates confusion.

Remove the erroneous nested paths (lines 15, 19–20) since the destructured parameters are already correctly documented on lines 16–18:

✏️ Proposed fix
 /**
  * Handles credit deduction after chat completion.
  * Calculates usage cost and deducts appropriate credits from the user's account.
  *
- * `@param` usage.usage
  * `@param` usage - The language model usage data
  * `@param` model - The model ID used for the chat
  * `@param` accountId - The account ID to deduct credits from (optional)
- * `@param` usage.model
- * `@param` usage.accountId
  */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* @param usage.usage
* @param usage - The language model usage data
* @param model - The model ID used for the chat
* @param accountId - The account ID to deduct credits from (optional)
* @param usage.model
* @param usage.accountId
* `@param` usage - The language model usage data
* `@param` model - The model ID used for the chat
* `@param` accountId - The account ID to deduct credits from (optional)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/credits/handleChatCredits.ts` around lines 15 - 20, The JSDoc for
HandleChatCreditsParams in lib/credits/handleChatCredits.ts has incorrect
duplicate nested params (usage.usage, usage.model, usage.accountId); update the
comment to remove those nested paths and only document the top-level parameters
as defined in the interface/function signature (usage, model, accountId) so the
JSDoc matches HandleChatCreditsParams and the destructured parameters used in
the function.

Comment on lines +7 to +12
* @param owner.owner
* @param owner - The GitHub repository owner
* @param repo - The GitHub repository name
* @param branch - The branch to fetch from
* @param owner.repo
* @param owner.branch
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix invalid nested JSDoc param paths.

Line 7, Line 11, and Line 12 introduce incorrect tags (owner.owner, owner.repo, owner.branch). Here, owner, repo, and branch are already top-level destructured params, so these nested paths are invalid and misleading.

Suggested doc fix
 /**
  * Fetches and parses .gitmodules from a GitHub repository.
  * Uses the GitHub Contents API (works for both public and private repos).
  *
- * `@param` owner.owner
  * `@param` owner - The GitHub repository owner
  * `@param` repo - The GitHub repository name
  * `@param` branch - The branch to fetch from
- * `@param` owner.repo
- * `@param` owner.branch
  * `@returns` Array of submodule entries, or null if .gitmodules doesn't exist or fetch fails
  */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* @param owner.owner
* @param owner - The GitHub repository owner
* @param repo - The GitHub repository name
* @param branch - The branch to fetch from
* @param owner.repo
* @param owner.branch
/**
* Fetches and parses .gitmodules from a GitHub repository.
* Uses the GitHub Contents API (works for both public and private repos).
*
* `@param` owner - The GitHub repository owner
* `@param` repo - The GitHub repository name
* `@param` branch - The branch to fetch from
* `@returns` Array of submodule entries, or null if .gitmodules doesn't exist or fetch fails
*/
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/github/getRepoGitModules.ts` around lines 7 - 12, The JSDoc contains
invalid nested param paths (owner.owner, owner.repo, owner.branch); update the
comment for the function (getRepoGitModules) to remove those incorrect tags and
ensure only top-level `@param` entries exist for owner, repo, and branch (and keep
any brief descriptions), so the doc matches the actual destructured parameters.

Comment on lines +9 to +12
* @param githubRepo.githubRepo
* @param githubRepo - The parent GitHub repository URL
* @param path - The file path to resolve
* @param githubRepo.path
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify JSDoc validity and lint compliance for this file
pnpm eslint lib/github/resolveSubmodulePath.ts

Repository: recoupable/api

Length of output: 160


🏁 Script executed:

cat -n lib/github/resolveSubmodulePath.ts

Repository: recoupable/api

Length of output: 1808


🏁 Script executed:

pnpm lint lib/github/resolveSubmodulePath.ts

Repository: recoupable/api

Length of output: 331


Fix malformed JSDoc parameter documentation for destructured arguments.

Lines 9 and 12 use nested notation (@param githubRepo.githubRepo, @param githubRepo.path) that doesn't match the function signature. The parameter is destructured with no explicit name, making this inconsistent and confusing for JSDoc tooling. Either document each destructured property directly (@param githubRepo, @param path) or name the parameter and use consistent nested notation throughout.

Suggested JSDoc patch
 /**
  * Resolves a file path that may be inside a git submodule.
  * If the path falls within a submodule, returns the submodule's repo URL
  * and the relative path within it. Otherwise returns the original values.
  *
- * `@param` githubRepo.githubRepo
- * `@param` githubRepo - The parent GitHub repository URL
- * `@param` path - The file path to resolve
- * `@param` githubRepo.path
+ * `@param` params - Input values for submodule path resolution
+ * `@param` params.githubRepo - The parent GitHub repository URL
+ * `@param` params.path - The file path to resolve
  * `@returns` The resolved repo URL and path
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/github/resolveSubmodulePath.ts` around lines 9 - 12, The JSDoc param
lines are inconsistent with the destructured signature in resolveSubmodulePath:
replace the nested `@param` githubRepo.githubRepo and `@param` githubRepo.path with
either (A) document the destructured properties directly—use `@param` {type}
githubRepo - description and `@param` {type} path - description to match the
function's githubRepo and path symbols—or (B) rename the function parameter to a
single options object in the signature and update JSDoc to `@param` {Object}
options and `@param` {type} options.githubRepo / `@param` {type} options.path; pick
one approach and make the JSDoc match the actual parameter names
(resolveSubmodulePath, githubRepo, path).

* @param params.artistInstruction - The artist instruction
* @param params.conversationName - The name of the conversation
* @param params.accountWithDetails - The account with details
* @param params.orgId
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a description for orgId in JSDoc for consistency.

Line 16 adds @param params.orgId but omits what it represents, while all adjacent params are documented. Please add a short description aligned with the nullable optional type.

Suggested update
- * `@param` params.orgId
+ * `@param` params.orgId - The organization ID of the account (or null for personal account)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* @param params.orgId
* `@param` params.orgId - The organization ID of the account (or null for personal account)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/prompts/getSystemPrompt.ts` at line 16, The JSDoc for getSystemPrompt is
missing a description for the parameter params.orgId; update the JSDoc block for
the getSystemPrompt (or the function that accepts params) to include a short
description like "Organization ID; nullable/optional string identifying the org
context" to match the other param entries and reflect its nullable optional
type.

Ran pnpm lint to auto-fix JSDoc stubs and other auto-fixable
issues. All tests pass. 481 manual errors remain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant